﻿
using MySql.Data.MySqlClient;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Data.OleDb;
using System.Data.SqlClient;

namespace zyconfig
{
    public class Common
    {
        public static string connectionString = DataBase.DbCon;

        public static string dbType = DataBase.DbType;

        public DbOperHandler Doh()
        {
            if(dbType.Equals("MYSQL"))
                return new OleDbOperHandler(new MySqlConnection(connectionString));
            if (dbType.Equals("ORACLE"))
                return new OleDbOperHandler(new OracleConnection(connectionString));
            if (dbType.Equals("ODBORA"))
                return new OleDbOperHandler(new OleDbConnection(connectionString), "odbora");
            return new OleDbOperHandler(new OleDbConnection(connectionString),null);
        }

    }
}
